﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="edjoblang.ascx.cs" Inherits="admin_edjob" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<table width="100%">
    <tr>
        <td>
            <asp:DropDownList ID="ddlID" runat="server" AutoPostBack="True" 
                DataSourceID="SqlDataSource3" DataTextField="description" DataValueField="id" Enabled="false"
                Height="28px" Width="303px">
            </asp:DropDownList>
            <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
                ConnectionString="<%$ ConnectionStrings:canhbuomxanhconnectionstring %>" 
                SelectCommand="SELECT [id], [description] FROM [Jobs] ORDER BY [id] DESC">
            </asp:SqlDataSource>
            </td>
    </tr>
    <tr>
        <td>
            <asp:DropDownList ID="ddlLang" runat="server" 
                DataSourceID="SqlDataSource1" DataTextField="lang" DataValueField="id" Enabled="false"
                Height="27px" Width="140px">
            </asp:DropDownList>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:canhbuomxanhconnectionstring %>" 
                SelectCommand="SELECT * FROM [Languages]"></asp:SqlDataSource>
            </td>
    </tr>
    <tr>
        <td>
            <asp:TextBox ID="menu" runat="server" Width="346px"></asp:TextBox>
            </td>
    </tr>
    <tr>
        <td>
            <asp:TextBox ID="txtTitle" runat="server" Width="346px" MaxLength="5000" 
                Rows="5" TextMode="MultiLine"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>
            <fckeditorv2:fckeditor ID="fckContent" runat="server" BasePath="~/fckeditor/">
            </fckeditorv2:fckeditor>
        </td>
    </tr>
    <tr>
        <td><center>
            <asp:Button runat="server" ID="addbt" Text="Cập nhật" 
                onclick="addbt_Click"/>
            <asp:HiddenField ID="hdfID" runat="server" />
            <asp:HiddenField ID="hdfContent" runat="server" />
            </center></td>
    </tr>
</table>
<asp:SqlDataSource ID="SqlDataSource4" runat="server" 
    ConnectionString="<%$ ConnectionStrings:canhbuomxanhconnectionstring %>" 
    SelectCommand="SELECT * FROM [Jobs_lang]" 
    
    UpdateCommand="UPDATE [Jobs_lang] SET [menu] = @menu, [title] = @title, [content] = @content WHERE [id] = @id AND [lang] = @lang">
    
    <UpdateParameters>
        <asp:ControlParameter ControlID="menu" Name="menu" PropertyName="Text" 
            Type="String" />
        <asp:ControlParameter ControlID="txtTitle" Name="title" PropertyName="Text" 
            Type="String" />
        <asp:ControlParameter ControlID="hdfContent" Name="content" 
            PropertyName="Value" Type="String" />
        <asp:ControlParameter ControlID="ddlID" Name="id" PropertyName="SelectedValue" 
            Type="Int64" />
        <asp:ControlParameter ControlID="ddlLang" Name="lang" 
            PropertyName="SelectedValue" Type="String" />
    </UpdateParameters>
    
</asp:SqlDataSource>
